import {
  createRouter,
  createWebHistory,
} from "vue-router";
import Layout from "../Layout/Layout.vue";



const routes = [{
    path: "",
    name: "导航",
    component: Layout,
    children: [{
        path: "",
        name: "主页",
        component: () => import("../pages/home/index.vue")
      },

      {
        path: "/admin/userlist",
        name: "用户管理",
        component: () => import("../pages/admin/userlist/index.vue")
      },

      {
        path: "/app01/ap1",
        name: "项目1",
        component: () => import("../pages/app01/ap1/index.vue")
      },


      {
        path: "/app01/ap2",
        name: "ap2",
        component: () => import("../pages/app01/ap2/index.vue")
      },

      {
        path: "/app01/phonomange",
        name: "项目2",
        component: () => import("../pages/app01/phonomange/index.vue")
      },


    ]
  },


  {
    path: "/login",
    name: "登录",
    component: () => import("../pages/login/index.vue")
  },

  {
    path: "/:catchAll(.*)", //设置找不到地址的网页的指向页面
    name: "404",
    component: () => import("../404/index.vue")
  }

];






const route = createRouter({
  //创建路由
  //   history: createWebHashHistory(), //哈希模式
  history: createWebHistory(),
  routes: routes,
});

export default route; //进行输出